<?php

namespace common\models\credit_app_tables;

use Yii;

/**
 * This is the model class for table "{{%order_log}}".
 *
 * @property integer $log_id
 * @property integer $log_uid
 * @property string $log_action
 * @property integer $log_related_id
 * @property string $log_explain
 * @property string $log_status
 * @property integer $log_dateline
 */
class OrderLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%order_log}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_app');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['log_uid', 'log_action', 'log_related_id', 'log_explain', 'log_dateline'], 'required'],
            [['log_uid', 'log_related_id', 'log_dateline'], 'integer'],
            [['log_explain', 'log_status'], 'string'],
            [['log_action'], 'string', 'max' => 30],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'log_id' => Yii::t('app', 'Log ID'),
            'log_uid' => Yii::t('app', '操作人ID'),
            'log_action' => Yii::t('app', '动作'),
            'log_related_id' => Yii::t('app', '相关ID'),
            'log_explain' => Yii::t('app', '说明'),
            'log_status' => Yii::t('app', 'Log Status'),
            'log_dateline' => Yii::t('app', '时间'),
        ];
    }
}
